import java.applet.*;
import java.awt.*;

public class Marquee extends Applet implements Runnable{
	String msg="Saibaba sarathbaba";
	Thread t=null;
	int state;
	boolean stopFlag;
	
	public void init(){
		setBackground(Color.blue.brighter());
		//setForeground(Color.white.brighter());
	}
	public void start(){
		t=new Thread(this);
		stopFlag=false;
		t.start();
	}
	public void run(){
		char ch;
		for( ; ;){
			try{
				repaint();
				Thread.sleep(250);
				ch=msg.charAt(0);
				msg=msg.substring(1,msg.length());
				msg+=ch;
				if(stopFlag)
					break;
			}catch(InterruptedException e){
			}
		}
	}
	public void stop(){
		stopFlag=true;
		t=null;
	}
	public void paint(Graphics g){
		g.setColor(Color.white);
		g.drawString(msg,100,100);
	}
}
